<?php
require_once('include/GeneralTop.php');
require('include/class/db.php');
$db = new db;

$pass_token = mysql_escape_string($_GET['token']);
$sql = "select member_id from member_info where pass_reclaim_bak='".$pass_token."'";
$query = $db->query($sql);
if(1 > $db->num($query)) {
	die("<div align='center'>error occured</div>");
}
else {
	$row = $db->fetch($query);
	$update = "update member_info set password='".$pass_token."' where member_id='".$row['member_id']."'";
	$db->query($update);
	echo "<div align='center'>Reset password successfully</div>
		  <div align='center'>Please go to <a href='index.php'>Home page</a> to login with the new password.</div>";
}

?>